<template>
	<el-form  :model="staffform" label-width="80px">
	
		<el-form-item label="工号">
			<el-input v-model="staffform.staffId"></el-input>
		</el-form-item>
		<el-form-item label="姓名">
			<el-input v-model="staffform.name"></el-input>
		</el-form-item>
		<el-form-item label="性别">
			<el-input v-model="staffform.sex"></el-input>
		</el-form-item>
		<el-form-item label="年龄">
			<el-input v-model="staffform.age"></el-input>
		</el-form-item>
		<el-form-item label="入职时间">
			<el-date-picker
			  v-model="staffform.hiredate"
			  type="date"
			format="yyyy-MM-dd"
			value-format="yyyy-MM-dd" 
			  placeholder="选择日期">
			</el-date-picker>
			
		
		</el-form-item>
		<el-form-item label="手机号">
			<el-input v-model="staffform.telphone"></el-input>
		</el-form-item>
		<el-form-item label="简介">
			<el-input v-model="staffform.content"></el-input>
		</el-form-item>
		<el-form-item label="备注">
			<el-input v-model="staffform.remarks"></el-input>
		</el-form-item>
		<el-form-item label="用户名">
			<el-input v-model="staffform.username"></el-input>
		</el-form-item>
		<el-form-item label="人员状态">
			<el-input v-model="staffform.status"></el-input>
		</el-form-item>
		<el-form-item label="密码">
			<el-input v-model="staffform.password"></el-input>
		</el-form-item>
		<el-button type="primary" @click="dostaffAdd">提交</el-button>
	</el-form>
</template>

<script>
	
	export default{
		name:'StaffAdd',
		props:[
			'dialogVisible',
			
		],
		data(){
			return {
				staffform:{
					staffId:'',
					name:'',
					sex:'',
					age:'',
					hiredate:'',
					telphone:'',
					content:'',
					remarks:'',
					username:'',
					status:'',
					password:''
				}
			}
		},
		methods:{
			dostaffAdd(){
				this.getRequest("/staff/insert",this.staffform).then(resp=>{
					if(resp){
						this.$emit("update:dialogVisible",false);
						this.$emit("add");
				
						console.log("你好")
					}else{
						this.$message.error({message:'保存失败'});
					}
				})
			}
		}
	}
</script>

<style>
</style>
